/*!
 * TidyBlog 2.0
 * Category create & edit page - v1.0 (2013-10-06T11:16:31+0800)
 * https://code.google.com/p/tidyblog/ | Released under MIT license
 */
define(function(require, exports, module) { 'use strict';

var $ = require('dom/1.0.x/'),
	Validator = require('validator/1.0.x/'),
	util = require('/common/util/1.0.x/');

new Validator({
	form: $('form'),
	steps: [
		{ fields: 'CategoryName', message: '分类名不能为空' },
		{ fields: 'Weight', rule: "min:0&&max:255", message: '权重必须为0-255' },
		{ 
			fields: 'Description',
			rule: 'maxLength:255',
			message: '描述不能超过255个字',
			required: false
		}
	],
	events: {
		submiterror: util.onSubmitError
	}
});

});